<?php
declare (strict_types = 1);

namespace app\index\controller;
use app\Request;
use \think\facade\View;
class User
{

    public function index()
    {
        //调用模型层  实例化  调用方法
        //不想实例化 可以在 模型层 加个静态化
        $user = new \app\index\model\User();  //指向 模型层 User  调用 model 下的 User
        $where['keywords']='唐僧';
        $list = $user->getUser(1);  //调用 模型类  调用 model 下的 User 下的 getUser 向 getUser 里传参
        //echo "<pre>";
        //print_r($list->toArray());
        //echo "</pre>";

        //echo "<pre>";
        //print_r($list->SexBm);
        //echo "</pre>";
        //
        //echo "<pre>";
        //print_r($list->AddtimeBm);
        //echo "</pre>";

        View::assign('list',$list);
        return view();

    }




    public function getInfo()
    {
        $info = \app\index\model\User::getUserInfo(1);
        echo "<pre>";
        print_r($info->toArray());
        echo "</pre>";
    }

    public function vList()
    {
        $kid = Request::param('kid');
        $where[] = ['uname','like',"%{$kid}%"];
        $list = \app\index\model\User::getvList($where);
        View::assign('list',$list);
        return view();
    }
}